home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 June / PCWorld_2007-06_cd.bin / temacd / wikipad / WikidPad-1.9beta2.exe / {app} / WikidPadHelp / data / ApiDocs.wiki < prev    next >
Encoding:
Text File  |  2006-04-26  |  7.7 KB  |  299 lines

  1. ∩╗┐++ wikidPad Hooks
  2.  
  3. Under the wikidPad install directory:
  4.  
  5. file:///C|/Program%20Files/WikidPad by default
  6.  
  7. There is a directory called "extensions".  In this folder there is a
  8. file called "wikidpadhooks.py". If you know Python you can extend
  9. wikidPad by hooking into the events sent to the methods defined
  10. in this file. For example, you could integrate wikidPad with cvs
  11. by plugging into the onopen, onsave, ondelete, onrename events.
  12.  
  13. file:///C|/Program%20Files/WikidPad/extensions/WikidPadHooks.py
  14. file:///C|/Program%20Files/WikidPad/user_extensions/WikidPadHooks.py
  15.  
  16. ++ API Documentation
  17.  
  18. The first argument to each hook function is the instance of the
  19. PersonalWikiFrame object which is the main window of the application.
  20. In scripts, this instance is automatically assigned to the variable
  21. "pwiki".
  22.  
  23. If you are reading the source code of WikidPad, this instance is often
  24. stored in member variable "pWiki", for some newer objects it has the
  25. name "mainControl".
  26.  
  27. *Selected functions of PersonalWikiFrame instance*
  28.  
  29. newWiki(wikiName, wikiDir)
  30.     Create a new wiki
  31.  
  32. openWiki(wikiConfigFilename, wikiWordToOpen=None, ignoreWdhName=False)
  33.     Open a wiki, and optionally a page in that wiki. if ignoreWdhName
  34.     is True, the program asks for the database type (same as
  35.     "Open as Type" in menu)
  36.  
  37. saveCurrentWikiState()
  38.     Write any changes to the wiki to disk.
  39.     
  40. openWikiPage(wikiWord)
  41.     Open a specific wiki word.
  42.  
  43. findCurrentWordInTree()
  44.     Select the currently open page in the tree control.
  45.     
  46. viewParents(word)
  47.     Pop up the dialog that shows the parents of the node passed in.
  48.  
  49. viewChildren()
  50.     Pop up the dialog that shows the children of the node passed in.
  51.  
  52. viewParentLess()
  53.     Pop up the dialog that shows the parentless nodes.
  54.  
  55. viewBookmarks()
  56.     Pop up the dialog that shows the bookmarked nodes.
  57.  
  58. viewHistory()
  59.     Pop up the dialog that shows the history of visited pages.
  60.  
  61. saveCurrentWikiPage()
  62.     Save the current wiki page to disk.
  63.  
  64. stdDialog(dlgtype, title, message, additional=None)
  65.     Show one of the standard dialogs. dlgtype is a string giving the type
  66.     of the desired dialog. title and message are strings to show in the
  67.     dialog, the meaning of additional and the return value depends on
  68.     the dialog type.
  69.     
  70.     Possible types:
  71.  
  72.     "text": input text to dialog, additional is the default text.
  73.         The function returns the entered text on OK or an empty string on Cancel
  74.     "o": Shows only OK button
  75.     "oc": Shows OK and Cancel buttons, returns either "ok" or "cancel"
  76.     "yn": Yes and No buttons, returns either "yes" or "no"
  77.     "ync": like "yn" but with additional cancel button, can also return
  78.         "cancel"
  79.  
  80.  
  81. displayErrorMessage(errorStr, exception)
  82.     Popup an exception dialog.
  83.  
  84.  
  85. getWikiData()
  86.     Get currently active WikiData object.
  87.     
  88. getActiveEditor()
  89.     Returns currently active editor control (currently there only can be one).
  90.  
  91. getCurrentWikiWord()
  92.     The currently open wiki word.
  93.     
  94. getCurrentDocPage()
  95.     Get the current DocPage object. (TODO)
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107. *The following documentation is outdated!*
  108.  
  109. The first argument to each hook function is wikidPad itself.  Here are
  110. the available methods on the wikidPad object.
  111.  
  112. *wikidPad functions*
  113.  
  114.  
  115. addToHistory(word)
  116.     Add the word passed in to the history.
  117.     
  118. goInHistory(positionDelta)
  119.     Go back or forward in history by the amount passed in.
  120.     
  121. goBackInHistory()
  122.     Go back in history one position.
  123.     
  124. goForwardInHistory()
  125.     Go forward in history one position.
  126.     
  127.        
  128. showWikiWordOpenDialog()
  129. showWikiWordRenameDialog()
  130. showWikiWordRenameConfirmDialog()
  131. showSearchDialog()
  132. showSavedSearchesDialog()
  133. showWikiWordDeleteDialog()
  134. showFindReplaceDialog()
  135.  
  136. displayMessage(title, msg)
  137.     Popup a dialog with the message passed in.
  138.     
  139.     
  140. *wikidPad.variables*
  141.  
  142. globalConfigDir
  143.     The directory of the wikidPad.config file.
  144.  
  145. globalConfigLoc
  146.     The wikidpad.config file.
  147.  
  148. globalConfig
  149.     The parsed wikidpad.config file.
  150.  
  151. wikiAppDir
  152.     The installation directory of wikidPad.
  153.     
  154. wikiPadHelp
  155.     The location of the help wiki.
  156.     
  157. config
  158.     The parsed configuration of the opened wiki.
  159.     
  160. wikiName
  161.     The name of the currently opened wiki.
  162.     
  163. dataDir
  164.     The data directory of the currently opened wiki.
  165.     
  166. wikiData
  167.     The database object for the currently open wiki. More on this below.
  168.     
  169. tree
  170.     The tree control on the left. The is a wxTreeCtrl. More on this below.
  171.  
  172.     
  173. editor
  174.     The text editor for wikidPad. This is a wxStyledTextCtrl. More on this below.
  175.     
  176.     
  177. *wikiData - The wiki database interface* 
  178.  
  179. getPage(wikiWord, itemsToLoad) 
  180.     Get the data for a wiki word. Pass in an array of strings for the items to load.
  181.     Valid items are: info, parents, children, props, todos.
  182.     For performance you specify which items should be loaded from the db. If you only
  183.     need info and children call:
  184.     
  185.     getPage(word, ["info", "children"])
  186.     
  187.     More on the return value of this function below.
  188.     
  189. getChildRelationships(wikiWord)
  190.     Returns array of the words that are children of the word passed in.
  191.     
  192. getParentRelationships(wikiWord)
  193.     Returns array of the words that are parents of the word passed in.
  194.     
  195. getAllWords()
  196.     Get all of the wiki words in the wiki.
  197.     
  198. getAllAliases()
  199.     Get all of the aliases in the wiki.
  200.     
  201. getAllRelations()
  202.     Get all of the relationships in the wiki. Returns array of tuples, (word, relatedTo).
  203.     
  204. getWikiWordsStartingWith(string)
  205. getWikiWordsWith(string)
  206. getWikiWordsModifiedWithin(days)
  207. getParentLessWords()
  208.  
  209. renameWord(word, toWord)
  210.     Rename a wiki word.
  211.     
  212. deleteWord(word)
  213.     Delete a wiki word.
  214.     
  215. getWordsWithPropertyValue(key, value)
  216.     Get all of the wiki words with a certain property value. For example
  217.     getWordsWithPropertyValue("icon", "pin") would get all of the wiki
  218.     words with "icon" set to "pin".
  219.  
  220. findBestPathFromWordToWord(word, toWord)
  221.     Returns the shortest path in the wiki from "word" to "toWord". Returned
  222.     as an array of wiki words.
  223.     
  224. search(forPattern)
  225.     Search the entire wiki using a regex.
  226.  
  227. getTodos()
  228.     Get all of the todos in the wiki. Returned as an array of tuples.
  229.  
  230. *wikiPage object*
  231.  
  232. wikiWord
  233.     The word.
  234.  
  235. wikiFile
  236.     The file that contains the data for this page.
  237.  
  238. parentRelations
  239.     Array of the parents words for this node.
  240.  
  241. childRelations
  242.     Array of the child words for this node.
  243.  
  244. todos
  245.     Array of todos
  246.  
  247. props
  248.     Hashtable of properties for the node.
  249.     
  250. getContent()
  251.     Get the string content for the node.
  252.  
  253. save()
  254.     Save the changes to this page to disk.
  255.     
  256.     
  257. *tree control*
  258.  
  259. collapse()
  260.     collapse the tree.
  261.     
  262. buildTreeForWord(wikiword)
  263.     Open the tree control to the wiki word passed in.
  264.     
  265. *text control*
  266.  
  267. setWrap(onOrOffBoolean)
  268.     Set the wrap mode to on/off.
  269.  
  270. SetText()
  271.     Set the text of the control.
  272.     
  273. snip()
  274.     Copy the currently selected text to the ScratchPad.
  275.  
  276. startIncrementalSearch(searchStr)
  277.     Set the search mode to incremental.
  278.     
  279. endIncrementalSearch()
  280.     Stop incremental search.
  281.  
  282. executeSearch(searchStr, searchStartPos=-1)
  283.     Execute a search of the text in the control.
  284.     
  285. getWikiWordText(position)
  286.     If position is in a wiki word return that word.
  287.     
  288. getWikiWordBeginEnd(position)
  289.     If position is in a wiki word return the start/end positions of the word.
  290.     
  291. isPositionInWikiWord(position)
  292.     Is the position in a wiki word?
  293.     
  294. isPositionInLink(position)
  295.     Is the position in a URL link?
  296.  
  297. See the wxWindows/wxPython documentation for info about the wxTreeCtrl and wxStyledTextCtrl.
  298.  
  299. [alias: WikidPadHooks]